<?php
error_reporting(0);
session_start();
include_once '../comm/config.php';
include_once '../comm/fahao.php';

$sql_shopinfo = "SELECT * FROM {$BIAOTOU}usershop WHERE `username` = '{$_SESSION["duoduouser"]}'";
$res = mysql_query($sql_shopinfo);
$shopinfo= mysql_fetch_array($res);

$sql_shoplevel = "SELECT * FROM {$BIAOTOU}shoplevel WHERE `id` = {$shopinfo['level']}";
$res = mysql_query($sql_shoplevel);
$shoplevel = mysql_fetch_array($res);

if($_GET['type'] == 'ajax'){
	//print_r($_FILES);
	$uploaddir = "../upload/activity/";
	$types = array("jpg","gif","bmp","jpeg","png");
	$type = substr(strrchr($_FILES['img_computer']['name'],'.'),1);
	if(!in_array(strtolower($type), $types)){
		$text=implode('.',$types);
		echo "您只能上传以下类型文件: ",$text,"<br>";die;
	}else{
		$filename=explode(".",$_FILES['img_computer']['name']);
		$time=date("m-d-H-i-s");
		$filename[0]=$time;
		$name=implode(".",$filename);
		$uploadfile=$uploaddir.$name;
	}
	move_uploaded_file($_FILES['img_computer']['tmp_name'],$uploadfile);
	echo $uploadfile;
	die;
}
include '../template/'.MOBAN.'/createmipiao.tpl.php';